package org.wu.framework.lazy.orm.core.persistence.reverse.lazy.mvc;

import org.wu.framework.lazy.orm.core.config.ReverseEngineering;
import org.wu.framework.lazy.orm.core.config.enums.OrmArchitecture;
import org.wu.framework.lazy.orm.core.persistence.reverse.ReverseClassLazyTableEndpoint;
import org.wu.framework.lazy.orm.core.persistence.reverse.lazy.similar.DefaultAbstractJavaReverseEngineeringMapperXmlMethod;
import org.wu.framework.core.NormalUsedString;

/**
 * description
 *
 * @author 吴佳伟
 * @date 2023/02/14 14:37
 */
public class DefaultMVCLazyMapperXml extends DefaultAbstractJavaReverseEngineeringMapperXmlMethod {


    public DefaultMVCLazyMapperXml(ReverseClassLazyTableEndpoint reverseClassLazyTableEndpoint, ReverseEngineering reverseEngineering) {
        super(reverseClassLazyTableEndpoint, reverseEngineering);
    }

    @Override
    public void initImportClassName() {

    }

    /**
     * description:  添加 class 上的注解
     * class 上的注解如  @LazyTableFieldId(name = "%s", comment = "%s")
     *
     * @author 吴佳伟
     * @date: 13.2.23 17:13
     */
    @Override
    public void initClassAnnotationPart() {
    }

    /**
     * description:  添加 class
     *
     * @author 吴佳伟
     * @date: 13.2.23 17:13
     */
    @Override
    public void initClassNamePart() {

    }


    /**
     * 创建 class 上下文代码
     *
     * @return Java内容编码
     */
    @Override
    public String createJavaContextCode() {
        if (OrmArchitecture.MYBATIS.equals(this.getOrmArchitecture())) {
            return super.createJavaContextCode();
        }
        return super.createMapperXml();
    }

    @Override
    protected String getPackage() {
        return NormalUsedString.EMPTY;
    }

    /**
     * description:  添加 class 字段片段
     *
     * @LazyTableFieldId(comment = "api参数主键")
     * private Long id;
     * </p>
     * @author 吴佳伟
     * @date: 13.2.23 17:13
     */
    @Override
    public void initClassFieldPart() {

    }

    @Override
    public String generateClassDescribe(String comment) {
        return NormalUsedString.EMPTY;
    }

    /**
     * 获取 文件module type
     *
     * @return
     */
    @Override
    protected String getModuleType() {
        return "xml";
    }

}
